<template>
  <div id="app" style="border: 3px solid #000; margin: 10px">
    <div>我是App组件</div>
    <div>{{ myTitle }}</div>
    <!-- 2. 父组件,对消息进行监听 -->
    <SonBox @changeTitle="handleChange"></SonBox>
  </div>
</template>

<script>
import SonBox from "./components/SonBox.vue";
export default {
 
  components: {
    SonBox,
  },
  data () {
    return {
      myTitle: "Hello World"
    }
  },
  methods: {
    // 提供处理函数,提供逻辑
    handleChange (flag) {
      this.myTitle = flag
    }
  }
};
</script>

<style></style>
